<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>设置</title>
		<script src="../js/mui.min.js"></script>
		<link href="../css/mui.min.css" rel="stylesheet" />

		<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
		<style>
			body,
			li,
			p,
			ul {
				margin: 0;
				padding: 0;
				font: 12px/1 Tahoma, Helvetica, Arial, "\5b8b\4f53", sans-serif;
			}
			
			ul,
			li,
			ol {
				list-style: none;
			}
			/* 重置文本格式元素 */
			
			a {
				text-decoration: none;
				cursor: pointer;
				color: #333333;
				font-size: 14px;
			}
			
			a:hover {
				text-decoration: none;
			}
			
			.clearfix::after {
				display: block;
				content: '';
				height: 0;
				overflow: hidden;
				clear: both;
			}
			/*星星样式*/
			
			.content {
				margin: 0 auto;
				padding-top: 20px;
			}
			
			.title {
				font-size: 14px;
				background: #dfdfdf;
				padding: 10px;
				margin-bottom: 10px;
			}
			
			.block {
				width: 100%;
				margin: 0 0 20px 0;
				padding-top: 10px;
				padding-left: 50px;
				line-height: 21px;
			}
			
			.block .star_score {
				float: left;
			}
			
			.star_list {
				height: 21px;
				margin: 50px;
				line-height: 21px;
			}
			
			.block p,
			.block .attitude {
				padding-left: 20px;
				line-height: 21px;
				display: inline-block;
			}
			
			.block p span {
				color: #C00;
				font-size: 16px;
				font-family: Georgia, "Times New Roman", Times, serif;
			}
			
			.star_score {
				background: url(../img/stark2.png);
				width: 160px;
				height: 21px;
				position: relative;
			}
			
			.star_score a {
				height: 21px;
				display: block;
				text-indent: -999em;
				position: absolute;
				left: 0;
			}
			
			.star_score a:hover {
				background: url(../img/stars2.png);
				left: 0;
			}
			
			.star_score a.clibg {
				background: url(../img/stars2.png);
				left: 0;
			}
			
			#starttwo .star_score {
				background: url(../img/starky.png);
			}
			
			#starttwo .star_score a:hover {
				background: url(../img/starsy.png);
				left: 0;
			}
			
			#starttwo .star_score a.clibg {
				background: url(../img/starsy.png);
				left: 0;
			}
			/*星星样式*/
			
			.show_number {
				padding-left: 50px;
				padding-top: 20px;
			}
			
			.show_number li {
				width: 240px;
				border: 1px solid #ccc;
				padding: 10px;
				margin-right: 5px;
				margin-bottom: 20px;
			}
			
			.atar_Show {
				background: url(../img/stark2.png);
				width: 160px;
				height: 21px;
				position: relative;
				float: left;
			}
			
			.atar_Show p {
				background: url(../img/stars2.png);
				left: 0;
				height: 21px;
				width: 134px;
			}
			
			.show_number li span {
				display: inline-block;
				line-height: 21px;
			}
		</style>


	</head>

	<body>

		
		<header class="mui-bar mui-bar-nav own-main-background-color">
			<button type="button" class="mui-action-back mui-btn  mui-btn-link mui-pull-left own-button">
			<!--<span class="mui-action-back mui-icon mui-icon-left-nav own-left-nav-color"></span>-->
			<span class="own-left-nav-color">返回</span>

			<h1 class="mui-title">登录</h1>
		</header>
		<div class="mui-content">

			<div class="content">
				<p style="font-size: 18px; margin-left: 5%;">
					匿名评价:
				</p>
	
				<div id="starttwo" class="block clearfix">
					<div class="star_score" id="wuxing"></div>
					 <p style="float:left;" ></p> <span class="fenshu"  id="star" hidden="hidden"></span>


						<div id="pingjia" class="attitude" style="font-size: 18px;"></div>
				</div>
			</div>

			<div class="row mui-input-row" style="padding:20px 15%;border-radius: 8px;">
				<textarea id='question' class="mui-input-clear question" placeholder="其他意见和建议(内容匿名，可放心填写)"></textarea>
			</div>
			
				
	<p id="subb" style=" margin-left: 15%; width: 70%; text-align: center; margin-top: 40px; background-color: #04BB21; height: 40px; font-size: 20px;border-radius: 8px;color: #FFFFFF;line-height: 40px;">提交评价</p>
		
				</div>
			
			<script type="text/javascript" src="../js/own.js" ></script>
		<script type="text/javascript" src="../js/startScore.js"></script>
		<script>
			scoreFun($("#startone"))
			scoreFun($("#starttwo"), {
				fen_d: 22, //每一个a的宽度
				ScoreGrade: 5 //a的个数 10或者
			})
			
			
				$(".show_number li p").each(function(index, element) {
				var num = $(this).attr("tip");
				var www = num * 2 * 16; //
				$(this).css("width", www);
				$(this).parent(".atar_Show").siblings("span").text(num + "分");
				
			});
			
		</script>

		
		
			<script>
					
					mui.plusReady(function() {
						
						var wuxing=document.getElementById("wuxing");
						wuxing.addEventListener("tap",function(){
							
							var pingjia=document.getElementById("pingjia").innerHTML;
						document.getElementById("question").value=pingjia;
						});
						
								 
					var self = plus.webview.currentWebview();						
						var	orderId =self.orderId;
						var	detailId =self.detailId;
						var	productId =self.productId
					
		
				var subb = document.getElementById("subb");
 
				subb.addEventListener("tap", function() {
						
					var data = {};
					data.accountId = plus.storage.getItem("accountId");
					data.tokenCode = plus.storage.getItem("tokenCode");
					data.orderId =orderId;
					data.detailId =detailId;
					data.productId =productId;
					data.star=document.getElementById("star").innerHTML;
					data.content=document.getElementById("question").value;
					mui.ajax(url + 'rest/evaluateOrder', {
						data: data, 
						dataType: 'json', //服务器返回json格式数据
						type: 'post', //HTTP请求类型
						timeout: 10000, //超时时间设置为10秒；      
						success: function(result) {
							//result = JSON.parse(result);
						
							if(result.status != '0') {
								mui.alert(result.msg + "!");
								//	plus.webview.currentWebview().reload()

							} else {
								mui.toast("评价成功");
								var ws = plus.webview.currentWebview();
								plus.webview.close(ws);

								var list = plus.webview.getWebviewById('template-sub-first.html');
								//触发列表界面的自定义事件（refresh）,
								//alert(list.id);
								mui.fire(list, 'refresh');

							}

						},
						error: function(xhr, type, errorThrown) {
							//异常处理；
							console.log(type);
						}
					});

				});
				
				});
			</script>

					

	
	
	</body>

</html>